package sudoku_gui;

import java.awt.Color;
import java.awt.Font;
import sudoku_properties.BasicSudokuParam;
import sudoku_properties.SudokuGameInfoParam;

/************************************************************
 * Class SudokuComponentsProperties
 * 1. Store components properties of Sudoku
 ************************************************************/
public class SudokuComponentsProperties {

    /* Constructor */
    public SudokuComponentsProperties(){}

    /* Set Size */
    public static int getSizeDeterminePos(){
        return SIZE_DETERMINE_POS;
    }
    public static int getSizeCaluCell(){
        return SIZE_CALU_CELL;
    }
    public static int getSizeCell(){
        return SIZE_CELL;
    }
    public static int getSizeBox(){
        return SIZE_BOX;
    }
    public static int getLSizeButton(){
        return LSIZE_BUTTON;
    }
    public static int getWSizeButton(){
        return WSIZE_BUTTON;
    }
    public static int getLSize(){
        return LSIZE;
    }
    public static int getLSizeVariable(){
        return LSIZE_VARIABLE;
    }
    public static int getWSizeVariable(){
        return WSIZE_VARIABLE;
    }
    public static int getWSizeBullet(){
        return WSIZE_BULLET;
    }
    public static int getWSizeSpinner(){
        return WSIZE_SPINNER;
    }
    public static int getWSizeStaticLabel(){
        return WSIZE_STATIC_LABEL;
    }
    public static int getBlockPaneSize(){
        return BLOCKPANE_SIZE;
    }
    public static int getWSizeSeparator(){
        return WSIZE_SEPARATOR;
    }
    public static int getLSizeSeparator(){
        return LSIZE_SEPARATOR;
    }
    public static int getWSizeHintsBox(){
        return WSIZE_HINTS_BOX;
    }
    public static int getLSizeHintsBox(){
        return LSIZE_HINTS_BOX;
    }
    public static int getWSizeHintsLabel(){
        return WSIZE_HINTS_LABEL;
    }
    public static int getWSizeHintsVariable(){
        return WSIZE_HINTS_VARIABLE;
    }

    /* Game Setting */
    public static int getGameStartPos(){
        return GAME_START_POS;
    }
    public static int getCellStartPos(){
        return CELL_START_POS;
    }
    public static int getDnDInputPosX(){
        return DND_INPUT_POSX;
    }
    public static int getDnDInputPosY(){
        return DND_INPUT_POSY;
    }
    public static int getStartButtonPosX(){
        return START_BUTTON_POSX;
    }
    public static int getStartButtonPosY(){
        return START_BUTTON_POSY;
    }
    public static int getStartLabelPosX(){
        return START_LABEL_POSX;
    }
    public static int getStartLabelPosY(){
        return START_LABEL_POSY;
    }
    public static int getItemSeperatorSpacing(){
        return ITEM_SEPARATOR_SPACING;
    }
    public static int getSpinnersSpacing(){
        return SPINNERS_SPACING;
    }
    public static int getTimerLabelPosX(){
        return TIMER_LABEL_POSX;
    }
    public static int getTimerLabelPosY(){
        return TIMER_LABEL_POSY;
    }
    public static int getBlockPanePos(){
        return BLOCKPANE_START_POS ;
    }
    public static int getSolvingStatusLabelPosX(){
        return SOLVING_STATUS_LABEL_POSX;
    }
    public static int getSolvingStatusLabelPosY(){
        return SOLVING_STATUS_LABEL_POSY ;
    }
    public static int getGameStatusLabelPosX(){
        return GAME_STATUS_LABEL_POSX;
    }
    public static int getGameStatusLabelPosY(){
        return GAME_STATUS_LABEL_POSY ;
    }
    public static int getStepsManageButtonPosX(){
        return STEPS_MANAGE_BUTTON_POSX;
    }
    public static int getStepsManageButtonPosY(){
        return STEPS_MANAGE_BUTTON_POSY ;
    }
    public static int getHintsStatusPosX(){
        return HINTS_STATUS_LABEL_POSX;
    }
    public static int getHintsStatusPosY(){
        return HINTS_STATUS_LABEL_POSY ;
    }
    public static int getSeparatorPosX(){
        return SEPARATOR_POSX;
    }
    public static int getSeparatorPosY(){
        return SEPARATOR_POSY;
    }
    public static int getCaluCellsClickPosX(){
        return CALU_CELLS_CLICK_POSX;
    }
    public static int getCaluCellsClickPosY(){
        return CALU_CELLS_CLICK_POSY;
    }
    public static int getAutoHintsClickPosX(){
        return AUTO_HINTS_CLICK_POSX;
    }
    public static int getAutoHintsClickPosY(){
        return AUTO_HINTS_CLICK_POSY;
    }
    public static int getHintsBoxPosX(){
        return HINTS_BOX_POSX;
    }
    public static int getHintsBoxPosY(){
        return HINTS_BOX_POSY;
    }
    public static int getDifficultyPosX(){
        return DIFFICULTY_POSX;
    }
    public static int getDifficultyPosY(){
        return DIFFICULTY_POSY;
    }
    public static int getPriorityPosX(){
        return PRIORITY_POSX;
    }
    public static int getPriorityPosY(){
        return PRIORITY_POSY;
    }
    /* color objects*/
    public static Color getColorBackground(){
        return COLOR_BACKGROUND;
    }
    public static Color getColorPositionLabel(){
        return COLOR_POSITION_LABEL;
    }
    public static Color getColorBoxBorder(){
        return COLOR_BOX_BORDER;
    }
    public static Color getColorBoxForeground(){
        return COLOR_BOX_FOREGROUND;
    }
    public static Color getColorCellContainersBorder(){
        return COLOR_CELL_CONTAINERS_BORDER ;
    }
    public static Color getColorCellContainersClickedBorder(){
        return COLOR_CELL_CONTAINERS_CLICKED_BORDER;
    }
    public static Color getColorCellContainersForeground(){
        return COLOR_CELL_CONTAINERS_FOREGROUND;
    }
    public static Color getColorHintsForeground(){
        return COLOR_HINT_FOREGROUND;
    }
    // 20091112 phrase2 start
    public static Color getColorCellValueByHintsForeground(){
        return COLOR_CELL_VALUE_BY_HINTS_FOREGROUND;
    }
    // 20091112 phrase2 end
    public static Color getColorCellValueForeground(){
        return COLOR_CELL_VALUES_FOREGROUND;
    }
    public static Color getColorGivenCellValueForeGround(){
        return COLOR_GIVEN_CELL_VALUES_FOREGROUND;
    }
    public static Color getColorGivenCellValueBackGround(){
        return COLOR_GIVEN_CELL_VALUES_BACKGROUND;
    }
    public static Color getColorCellValuesHighlightForeground(){
        return COLOR_CELL_VALUES_HIGHLIGHT_FOREGROUND ;
    }
    public static Color getColorCellValuesClickedForeground(){
        return COLOR_CELL_VALUES_CLICKED_FOREGROUND;
    }
    public static Color getColorCalculationCellForeground(){
        return COLOR_CALCULATION_CELL_FOREGROUND;
    }
    public static Color getColorCalculationCellHighlightForeground(){
        return COLOR_CALCULATION_CELL_HIGHLIGHT_FOREGROUND;
    }
    public static Color getColorSameValueHighlightForeground(){
        return COLOR_SAME_VALUE_HIGHLIGHT_FOREGROUND;
    }
    public static Color getColorDnDLabelForeground(){
        return COLOR_DND_LABEL_FOREGROUND;
    }
    public static Color getColorDnDLabelBorder(){
        return COLOR_DND_LABEL_BORDER;
    }
    public static Color getColorButtonBackground(){
        return COLOR_BUTTON_BACKGROUND;
    }
    public static Color getColorButtonForeground(){
        return COLOR_BUTTON_FOREGROUND;
    }
    public static Color getColorSpinnerArrow(){
        return COLOR_SPINNER_ARROW;
    }
    public static Color getColorSpinnerArrowDisabled(){
        return COLOR_SPINNER_ARROW_DISABLED;
    }
    public static Color getColorSpinnerArrowShadow(){
        return COLOR_SPINNER_ARROW_SHADOW;
    }
    public static Color getColorSpecial(){
        return COLOR_SPECIAL;
    }
    public static Color getColorBlockPane(){
        return COLOR_BLOCKPANE;
    }
    public static Color getColorHintsBox(){
        return COLOR_HINTS_BOX;
    }
    /* Font objects */
    public static Font getFontDeterminePos(){
        return FONT_DETERMINE_POS;
    }
    public static Font getFontCellValue(){
        return FONT_CELL_VALUE;
    }
    public static Font getFontCaluCell(){
        return FONT_CALU_CELL;
    }
    public static Font getFontDnDLabel(){
        return FONT_DND_LABEL;
    }
    public static Font getFontButton(){
        return FONT_BUTTON;
    }
    public static Font getFontItemsLabel(){
        return FONT_ITEMS_LABEL;
    }
    public static Font getFontSupportStartLabel(){
        return FONT_SUPPORT_START_LABEL ;
    }
    public static Font getFontSpecial(){
        return FONT_SPECIAL ;
    }
    public static Font getFontBlockPane(){
        return FONT_BLOCKPANE ;
    }
    public static Font getFontBox(){
        return FONT_BOX;
    }
    public static Font getFontGameStatus(){
        return FONT_GAME_STATUS;
    }
    public static Font getFontHintsBox(){
        return FONT_HINTS_BOX;
    }

    /* Algiment objects */
    public static int getAlgimentCenter(){
        return ALGIMENT_CENTER;
    }
    public static int getAlgimentLeft(){
        return ALGIMENT_LEFT;
    }
    public static int getAlgimentRight(){
        return ALGIMENT_RIGHT;
    }

    /* Layer Index */
    public static int getLayerIndexCellsCalu(){
        return LAYER_INDEX_CELLS_CALU;
    }
    public static int getLayerIndexCellsValue(){
        return LAYOUT_INDEX_CELLS_VALUE;
    }

    /* Boolean Objects */
    public static boolean getIsTrue(){
        return IS_TRUE;
    }
    public static boolean getIsFalse(){
        return IS_FALSE;
    }

    /* Hints Panel Separator */
    public static String getHintsPanelSeparator(){
        return HINTS_PANEL_SEPARATOR;
    }

    /* Roman Converter */
    public static String[] getRoman(){
        return ROMAN;
    }

    /*****************
     * UI variables **
     *****************/

    /*Size objects*/
    /* Game Area Panel */
    private final static int SIZE_DETERMINE_POS= 2;
    private final static int SIZE_CALU_CELL = 15 ;
    private final static int SIZE_CELL = SIZE_CALU_CELL * BasicSudokuParam.getBoxLengthInCells();
    private final static int SIZE_BOX = SIZE_CELL* BasicSudokuParam.getBoxLengthInCells();
    private final static int BLOCKPANE_SIZE = 375;
    /* Game Info Panel */
    private final static int LSIZE_BUTTON = 26;
    private final static int WSIZE_BUTTON = 100;
    private final static int LSIZE = 20;
    private final static int WSIZE_BULLET = 15;
    private final static int WSIZE_SPINNER = 150;
    private final static int WSIZE_STATIC_LABEL = 260;
    private final static int LSIZE_VARIABLE = LSIZE_BUTTON;
    private final static int WSIZE_VARIABLE = WSIZE_STATIC_LABEL - WSIZE_BUTTON;
    /* The size of label that determine variable */
    private final static int WSIZE_HINTS_LABEL = 100;
    private final static int WSIZE_HINTS_VARIABLE = WSIZE_STATIC_LABEL - WSIZE_BULLET - WSIZE_BUTTON - WSIZE_HINTS_LABEL;
    private final static int LSIZE_SEPARATOR = 10;
    private final static int WSIZE_SEPARATOR = 260;
    /* Hints Panel */
    private final static int LSIZE_HINTS_BOX = 195;
    private final static int WSIZE_HINTS_BOX = 485;


    /* Game Setting */
    /* Game Area Panel */
    private final static int GAME_START_POS= 5;
    private final static int CELL_START_POS = GAME_START_POS + SIZE_CELL;
    private final static int DND_INPUT_POSX = GAME_START_POS *3/2;
    private final static int DND_INPUT_POSY = GAME_START_POS + ( SIZE_CELL* BasicSudokuParam.getNumCellsInUnit() ) + SIZE_CELL + SIZE_CELL/2;
    private final static int BLOCKPANE_START_POS = 15;
    /* Game Info Panel */
    private final static int ITEM_SEPARATOR_SPACING = 5;
    private final static int SPINNERS_SPACING = 2;
    private final static int START_BUTTON_POSX = 10;
    private final static int START_BUTTON_POSY = 20;
    private final static int START_LABEL_POSX = START_BUTTON_POSX;
    private final static int START_LABEL_POSY = START_BUTTON_POSY + LSIZE_BUTTON;
    /* Difficulty label + spinner */
    private final static int DIFFICULTY_POSX = START_LABEL_POSX;
    private final static int DIFFICULTY_POSY = START_LABEL_POSY + LSIZE + ITEM_SEPARATOR_SPACING;
    /* Priority label + spinner(s) + spinner_spacing(s) */
    private final static int PRIORITY_POSX = DIFFICULTY_POSX;
    private final static int PRIORITY_POSY = DIFFICULTY_POSY + LSIZE +  LSIZE + ITEM_SEPARATOR_SPACING;
    /* Timer Label + variable */
    private final static int TIMER_LABEL_POSX = PRIORITY_POSX;
    private final static int TIMER_LABEL_POSY = PRIORITY_POSY + LSIZE
            + (LSIZE + SPINNERS_SPACING)*SudokuGameInfoParam.getLogicalRules().length + ITEM_SEPARATOR_SPACING;
    /* Solving status label + variable */
    private final static int SOLVING_STATUS_LABEL_POSX= TIMER_LABEL_POSX;
    private final static int SOLVING_STATUS_LABEL_POSY = TIMER_LABEL_POSY + LSIZE
            + LSIZE_VARIABLE + ITEM_SEPARATOR_SPACING;
    /* Hints status Label + Variable(s) */
    private final static int HINTS_STATUS_LABEL_POSX = SOLVING_STATUS_LABEL_POSX;
    private final static int HINTS_STATUS_LABEL_POSY = SOLVING_STATUS_LABEL_POSY
            + LSIZE + LSIZE_VARIABLE + ITEM_SEPARATOR_SPACING;
    /* Game status Variable */
    private final static int GAME_STATUS_LABEL_POSX = HINTS_STATUS_LABEL_POSX;
    private final static int GAME_STATUS_LABEL_POSY = HINTS_STATUS_LABEL_POSY + LSIZE
            + (LSIZE_VARIABLE+SPINNERS_SPACING)*SudokuGameInfoParam.getHintsLevel().length + ITEM_SEPARATOR_SPACING;
    /* Separator Separator + label */
    private final static int SEPARATOR_POSX = GAME_STATUS_LABEL_POSX;
    private final static int SEPARATOR_POSY = GAME_STATUS_LABEL_POSY + LSIZE_VARIABLE + ITEM_SEPARATOR_SPACING;

    private final static int CALU_CELLS_CLICK_POSX = SEPARATOR_POSX;
    private final static int CALU_CELLS_CLICK_POSY = SEPARATOR_POSY + + LSIZE 
            + LSIZE_SEPARATOR + ITEM_SEPARATOR_SPACING;
    private final static int AUTO_HINTS_CLICK_POSX = CALU_CELLS_CLICK_POSX;
    private final static int AUTO_HINTS_CLICK_POSY = CALU_CELLS_CLICK_POSY+ LSIZE + ITEM_SEPARATOR_SPACING;
    private final static int STEPS_MANAGE_BUTTON_POSX = AUTO_HINTS_CLICK_POSX;
    private final static int STEPS_MANAGE_BUTTON_POSY = AUTO_HINTS_CLICK_POSY + LSIZE + ITEM_SEPARATOR_SPACING;
    /* Hints Panel */
    private final static int HINTS_BOX_POSX = 10;
    private final static int HINTS_BOX_POSY = 20;



    /* Color objects */
    /* Game Area Panel */
    private final static Color COLOR_BACKGROUND = new java.awt.Color( 255, 255, 255 ) ;
    private final static Color COLOR_POSITION_LABEL = new java.awt.Color( 222, 222, 209 ) ;
    private final static Color COLOR_BOX_BORDER = new java.awt.Color( 255, 0, 0) ;
    private final static Color COLOR_BOX_FOREGROUND = new java.awt.Color( 222, 222, 209 ) ;
    private final static Color COLOR_CELL_CONTAINERS_BORDER = new java.awt.Color(255, 204, 204 ) ;
    private final static Color COLOR_CELL_CONTAINERS_CLICKED_BORDER = new java.awt.Color( 255, 135, 0 ) ;
    private final static Color COLOR_CELL_CONTAINERS_FOREGROUND = new java.awt.Color( 229, 229, 229 ) ;
    private final static Color COLOR_HINT_FOREGROUND = new java.awt.Color( 233, 111, 7) ;
    private final static Color COLOR_CELL_VALUES_FOREGROUND = new java.awt.Color( 0, 0, 0 ) ;
    // 20091112 phrase2 start
    private final static Color COLOR_CELL_VALUE_BY_HINTS_FOREGROUND = new java.awt.Color( 204, 204, 204) ;
    // 20091112 phrase2 end
    private final static Color COLOR_GIVEN_CELL_VALUES_FOREGROUND = new java.awt.Color( 255, 0, 0 ) ;
    private final static Color COLOR_GIVEN_CELL_VALUES_BACKGROUND = new java.awt.Color( 255, 234, 234 ) ;
    private final static Color COLOR_CELL_VALUES_HIGHLIGHT_FOREGROUND = new java.awt.Color( 217, 127, 127 ) ;
    private final static Color COLOR_CELL_VALUES_CLICKED_FOREGROUND = new java.awt.Color( 255, 153, 0 ) ;
    private final static Color COLOR_CALCULATION_CELL_FOREGROUND = new java.awt.Color( 222, 222, 209 ) ;
    private final static Color COLOR_CALCULATION_CELL_HIGHLIGHT_FOREGROUND = new java.awt.Color( 217, 127, 127 ) ;
    private final static Color COLOR_SAME_VALUE_HIGHLIGHT_FOREGROUND = new java.awt.Color( 0, 0, 0 ) ;
    private final static Color COLOR_DND_LABEL_FOREGROUND = new java.awt.Color( 0, 0, 0 );
    private final static Color COLOR_DND_LABEL_BORDER = new java.awt.Color( 255, 0, 0 );
    private final static Color COLOR_BLOCKPANE = new java.awt.Color( 255, 204, 204 );
    /* Game Info Panel */
    private final static Color COLOR_BUTTON_BACKGROUND = new java.awt.Color( 255, 255, 255 );
    private final static Color COLOR_BUTTON_FOREGROUND = new java.awt.Color( 255, 0, 0 );
    private final static Color COLOR_SPINNER_ARROW = new java.awt.Color( 255, 0, 0 );
    private final static Color COLOR_SPINNER_ARROW_DISABLED = new java.awt.Color( 204, 204, 204 );
    private final static Color COLOR_SPINNER_ARROW_SHADOW = new java.awt.Color( 204, 204, 204 );
    private final static Color COLOR_SPECIAL = new java.awt.Color( 255, 0, 0 );
    /* Hints Panel */
    private final static Color COLOR_HINTS_BOX = new java.awt.Color( 255, 230, 230 );

    /* Font objects */
    /* Game Area Panel */
    private final static Font FONT_DETERMINE_POS = new java.awt.Font("Old English Text MT", Font.PLAIN, 24) ;
    private final static Font FONT_CELL_VALUE = new java.awt.Font("Arial", Font.PLAIN, 36) ;
    private final static Font FONT_CALU_CELL = new java.awt.Font("Arial", Font.PLAIN, 12) ;
    private final static Font FONT_DND_LABEL = new java.awt.Font("Arial Unicode MS", Font.PLAIN, 24) ;
    private final static Font FONT_BLOCKPANE = new java.awt.Font("Arial Unicode MS", Font.PLAIN, 50) ;
    private final static Font FONT_BOX = new java.awt.Font("Arial Unicode MS", Font.ITALIC, 50) ;
    /* Game Info Panel */
    private final static Font FONT_ITEMS_LABEL = new java.awt.Font("Arial Unicode MS", Font.PLAIN, 12) ;
    private final static Font FONT_BUTTON = new java.awt.Font("Arial Unicode MS", Font.PLAIN, 12) ;
    private final static Font FONT_SUPPORT_START_LABEL = new java.awt.Font("Arial Unicode MS", Font.BOLD, 12) ;
    private final static Font FONT_SPECIAL = new java.awt.Font("Arial Unicode MS", Font.BOLD, 20) ;
    private final static Font FONT_GAME_STATUS = new java.awt.Font("Arial Unicode MS", Font.ITALIC, 12) ;
    private final static Font FONT_HINTS_BOX = new java.awt.Font("Arial Unicode MS", Font.PLAIN, 12) ;

    /* Algiment objects */
    /* Game Area Panel */
    private final static int ALGIMENT_CENTER = javax.swing.SwingConstants.CENTER;
    private final static int ALGIMENT_LEFT = javax.swing.SwingConstants.LEFT;
    private final static int ALGIMENT_RIGHT = javax.swing.SwingConstants.RIGHT;

    /* Layer Index */
    /* Game Area Panel */
    private final static int LAYER_INDEX_CELLS_CALU = new Integer(1);
    private final static int LAYOUT_INDEX_CELLS_VALUE = new Integer(2);

    /* Boolean Objects*/
    private final static boolean IS_TRUE = true;
    private final static boolean IS_FALSE = false;

    /* Hints Panel Separator */
    private final static String HINTS_PANEL_SEPARATOR = "\n--------------------------------------------------------------------------------------------------------------------\n";

    /* Roman Convertion */
    private final static String[] ROMAN = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};

}
